#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: ix-shutdown
# REQUIRE: LOGIN
# KEYWORD: shutdown

. /etc/rc.subr

do_shutdown()
{
	/usr/local/bin/midclt call core.event_send system ADDED '{"id": "shutdown"}' > /dev/null

	/usr/local/bin/midclt call -job initshutdownscript.execute_init_tasks SHUTDOWN > /dev/null 2>&1
}

name="ix-shutdown"
start_cmd=':'
stop_cmd='do_shutdown'

load_rc_config $name
run_rc_command "$1"
